package com.ruoyi.fullminusgiveaway.service.impl;

import com.ruoyi.fullminusgiveaway.domain.FullMinusGiveaway;
import com.ruoyi.fullminusgiveaway.domain.Goods;
import com.ruoyi.fullminusgiveaway.domain.Vo.fullGoods;
import com.ruoyi.fullminusgiveaway.mapper.FullMinusGiveawayMapper;
import com.ruoyi.fullminusgiveaway.mapper.fullminusMapper;
import com.ruoyi.fullminusgiveaway.service.fullminusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class fullminusServiceImpl implements fullminusService {
    @Autowired
    private fullminusMapper fullminusMapper;

    /**
     * 查询满送活动
     *
     * @param id 满送活动主键
     * @return 满送活动
     */
    @Override
    public fullGoods selectFullMinusGiveawayByIdMinus(Long id)
    {
        return fullminusMapper.selectFullMinusGiveawayByIdMinus(id);
    }

    @Override
    public List<FullMinusGiveaway> selectFullMinusGiveawayListMinus(String goodsName, String reduceMoney, String businessName, String shopName) {
        return fullminusMapper.selectFullMinusGiveawayListMinus(goodsName,reduceMoney,businessName,shopName);
    }

    /**
     * 查询满送活动列表
     *
     * @param fullMinusGiveaway 满送活动
     * @return 满送活动
     */

    /**
     * 新增满送活动
     *
     * @param fullMinusGiveaway 满送活动
     * @return 结果
     */
    @Override
    public int insertFullMinusGiveawayMinus(FullMinusGiveaway fullMinusGiveaway)
    {
        return fullminusMapper.insertFullMinusGiveawayMinus(fullMinusGiveaway);
    }

    /**
     * 修改满送活动
     *
     * @param fullMinusGiveaway 满送活动
     * @return 结果
     */
    @Override
    public int updateFullMinusGiveawayMinus(fullGoods fullGoods)
    {
        System.out.println("service:"+fullGoods.getId());
        System.out.println("service:"+fullGoods.getGoods().getGoodsName());
        System.out.println("service:"+fullGoods.getMoney());
        return fullminusMapper.updateFullMinusGiveawayMinus(fullGoods);
    }

    /**
     * 批量删除满送活动
     *
     * @param ids 需要删除的满送活动主键
     * @return 结果
     */
    @Override
    public int deleteFullMinusGiveawayByIdsMinus(Long[] ids)
    {
        return fullminusMapper.deleteFullMinusGiveawayByIdsMinus(ids);
    }

    /**
     * 删除满送活动信息
     *
     * @param id 满送活动主键
     * @return 结果
     */
    @Override
    public int deleteFullMinusGiveawayByIdMinus(Long id)
    {
        return fullminusMapper.deleteFullMinusGiveawayByIdMinus(id);
    }

    @Override
    public List<Goods> goodsList() {
        return fullminusMapper.goodsList();
    }

    @Override
    public int selectAddGoodsName(String goodsName) {
        return fullminusMapper.selectAddGoodsName(goodsName);
    }
}
